#!/bin/sh

WORK_DIR=javadoc

rm -rf $WORK_DIR

mkdir $WORK_DIR

cp -rf framework* $WORK_DIR
cp -f pom.xml $WORK_DIR

cd $WORK_DIR

echo "generate javadoc ..."
mvn gplus:generateStubs 

find . -name "*.groovy" | xargs rm -rf

DIRS=`find . -maxdepth 2 -name "framework*"`

for VAR in $DIRS
do
  cp -rf $VAR/target/generated-sources/groovy-stubs/main/com $VAR/src/main/java
done

mvn javadoc:javadoc

echo "generate javadoc done"